/**
 * 
 */
package com.pmsco.pms.util;

import org.apache.commons.codec.binary.Base64;

/**
 * @author Long Tran
 *
 */
public class PmsBase64Encoder implements PmsEncoder {

	public String encode(String stringToEncode) {
		if(stringToEncode == null)
			return "";
		return new String(Base64.encodeBase64(stringToEncode.getBytes()));
	}

	public String decode(String stringToDecode) {
		if(stringToDecode == null)
			return "";
		return new String(Base64.decodeBase64(stringToDecode.getBytes()));
	}

}
